Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add support for oci1.1 cosign signatures #1963

Merged
merged 1 commit into from
Nov 6, 2023

Conversation

Andreea-Lupu
Copy link
Contributor

What type of PR is this?

Which issue does this PR fix:

What does this PR do / Why do we need it:

If an issue # is not available please add repro steps and logs showing the issue:

Testing done on this change:

Automation added to e2e:

Will this break upgrades or downgrades?

Does this PR introduce any user-facing change?:


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@Andreea-Lupu Andreea-Lupu force-pushed the add_support_cosign_oci1.1 branch from 7e75c5a to bd8221d Compare October 25, 2023 10:13
@codecov
Copy link

codecov bot commented Oct 25, 2023

Codecov Report

Merging #1963 (485c41e) into main (6a66a9b) will increase coverage by 0.07%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main    #1963      +/-   ##
==========================================
+ Coverage   90.07%   90.14%   +0.07%     
==========================================
  Files         164      164              
  Lines       27563    27642      +79     
==========================================
+ Hits        24826    24919      +93     
+ Misses       2020     2008      -12     
+ Partials      717      715       -2     
Files Coverage Δ
pkg/cli/client/client.go 87.00% <100.00%> (+0.61%) ⬆️
pkg/common/common.go 95.38% <ø> (ø)
pkg/extensions/sync/references/oci.go 93.58% <100.00%> (+1.92%) ⬆️
pkg/extensions/sync/references/references.go 97.76% <100.00%> (+4.28%) ⬆️
pkg/meta/boltdb/boltdb.go 81.27% <100.00%> (+0.23%) ⬆️
pkg/meta/dynamodb/dynamodb.go 80.34% <100.00%> (+0.41%) ⬆️
pkg/meta/parse.go 81.50% <100.00%> (+0.28%) ⬆️
pkg/meta/types/types.go 100.00% <ø> (ø)
pkg/storage/common/common.go 93.02% <100.00%> (+0.02%) ⬆️
pkg/storage/gc/gc.go 91.60% <100.00%> (+0.03%) ⬆️
... and 3 more

📣 Codecov offers a browser extension for seamless coverage viewing on GitHub. Try it in Chrome or Firefox today!

@adodon2go adodon2go linked an issue Oct 25, 2023 that may be closed by this pull request
@Andreea-Lupu Andreea-Lupu force-pushed the add_support_cosign_oci1.1 branch 6 times, most recently from 8f3596e to 704ac00 Compare October 30, 2023 09:06
@Andreea-Lupu Andreea-Lupu marked this pull request as ready for review October 30, 2023 09:40
pkg/storage/common/common.go Show resolved Hide resolved
pkg/storage/storage.go Show resolved Hide resolved
@Andreea-Lupu Andreea-Lupu force-pushed the add_support_cosign_oci1.1 branch 2 times, most recently from af8a1ab to 5884764 Compare November 1, 2023 11:39
pkg/test/oci-utils/oci_layout_test.go Outdated Show resolved Hide resolved
pkg/test/oci-utils/oci_layout.go Outdated Show resolved Hide resolved
pkg/test/oci-utils/oci_layout.go Outdated Show resolved Hide resolved
pkg/cli/client/client.go Outdated Show resolved Hide resolved
pkg/cli/client/image_cmd_test.go Outdated Show resolved Hide resolved
@Andreea-Lupu Andreea-Lupu force-pushed the add_support_cosign_oci1.1 branch from 5884764 to f8eb8c4 Compare November 1, 2023 15:30
Copy link
Collaborator

@adodon2go adodon2go left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

pkg/cli/client/image_cmd_test.go Show resolved Hide resolved
@rchincha rchincha added this to the v2.0.0 milestone Nov 1, 2023
@adodon2go adodon2go force-pushed the add_support_cosign_oci1.1 branch from f8eb8c4 to 738ba1d Compare November 1, 2023 22:02
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

- Cosign supports 2 types of signature formats:

	1. Using tag -> each new signature of the same manifest is
	added as a new layer of the signature manifest having that
	specific tag("{alghoritm}-{digest_of_signed_manifest}.sig")

	2. Using referrers -> each new signature of the same manifest is
	added as a new manifest

- For adding these cosign signature to metadb, we reserved index 0 of the
list of cosign signatures for tag-based signatures. When a new tag-based
signature is added for the same manifest, the element on first position
in its list of cosign signatures(in metadb) will be updated/overwritten.
When a new cosign signature(using referrers) will be added for the same
manifest this new signature will be appended to the list of cosign
signatures.

Signed-off-by: Andreea-Lupu <[email protected]>
@adodon2go adodon2go force-pushed the add_support_cosign_oci1.1 branch from 738ba1d to 485c41e Compare November 6, 2023 16:33
@rchincha rchincha merged commit d506551 into project-zot:main Nov 6, 2023
33 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feat]: Test cosign support for OCI spec 1.1 in zot CI
4 participants